<% if step.blank? and @step.present? then step = @step end %>
<% step_type_str = step.completed ? 'completed' : 'uncompleted' %>
<% user = step.completed || !step.changed? ? step.user : step.last_modified_by %>
<% timestamp = step.completed ? step.completed_on : step.updated_at %>
<% tables = step.tables %>
<% assets = step.assets %>
<% checklists = step.checklists %>
<% comments = step.step_comments %>
<% for_export_all = defined?(export_all) && export_all %>
<div class="report-element report-step-element"
     data-ts="<%= timestamp.to_i %>"
     data-type="step"
     data-id='{ "step_id": <%= step.id %> }'
     data-scroll-id="<%= step.id %>"
     data-modal-title="<%=t "projects.reports.elements.modals.step_contents.head_title", step: step.name %>"
     data-name="<%=t "projects.reports.elements.step.sidebar_name", pos: (step.position_plus_one), name: step.name %>"
     data-icon-class="fas fa-arrow-circle-right">
  <div class="report-element-header">
    <div class="row">
      <div class="pull-left user-time">
        <%=t "projects.reports.elements.step.#{step_type_str}.user_time", user: user.full_name , timestamp: l(timestamp, format: :full) %>
      </div>
      <div class="pull-right controls">
        <%= render partial: "reports/elements/element_controls.html.erb", locals: { show_sort: true } %>
      </div>
    </div>
  </div>
  <div class="report-element-body">
    <div class="row">
      <div class="pull-left step-name">
        <h5>
          <span class="fas fa-arrow-circle-right"></span>
          <b><%=t "projects.reports.elements.step.step_pos", pos: (step.position_plus_one) %></b>&nbsp;<%= step.name %>
          <%= step_status_label(step) %>
        </h5>
      </div>
    </div>
    <div class="row">
      <div class="col-xs-12 ql-editor">
        <% if step.description.present? %>
          <%= custom_auto_link(step.prepare_for_report(:description, for_export_all),
                               team: current_team,
                               simple_format: false,
                               tags: %w(img),
                               base64_encoded_imgs: for_export_all) %>
        <% else %>
          <em><%=t "projects.reports.elements.step.no_description" %></em>
        <% end %>
      </div>
    </div>
  </div>
  <div class="report-element-children">
    <%= children if (defined? children and children.present?) %>
  </div>
</div>
